{% extends 'base.html' %}
{% load static %}
{% block title %}问题详情{% endblock %}
{% block left-sidebar %}
    <li class="has-sub {% if request.path|slice:':10' == '/plans/ex_' %}active  {% endif %} expand">
        <a class="sidenav-item-link" href="javascript:void(0)" data-toggle="collapse"
           data-target="#dashboard"
           aria-expanded="false" aria-controls="dashboard">
            <i class="mdi mdi-dribbble"></i>
            <span class="nav-text">返回上一级</span> <b class="caret"></b>
        </a>
        <ul class="collapse {% if request.path|slice:':14' == '/plans/ex_list' %} show {% endif %}" id="dashboard"
            data-parent="#sidebar-menu">
            <div class="sub-menu">

                <li {% if request.path|slice:':14' == '/plans/ex_list' %}
                    class="active" {% endif %}>
                    <a class="sidenav-item-link" href="{% url 'plans:ex_list' %}">
                        <span class="nav-text">项目列表</span>
                    </a>
                </li>

            </div>
        </ul>
    </li>
    <li class="has-sub {% if request.path|slice:':9' == '/plans/st' %}active  {% endif %} expand">
        <a class="sidenav-item-link" href="javascript:void(0)" data-toggle="collapse"
           data-target="#dashboard1"
           aria-expanded="false" aria-controls="dashboard">
            <i class="mdi mdi-docker"></i>
            <span class="nav-text">前期准备</span> <b class="caret"></b>
        </a>
        <ul class="collapse {% if request.path|slice:':9' == '/plans/st' %}show  {% endif %}" id="dashboard1"
            data-parent="#sidebar-menu">
            <div class="sub-menu">

                <li {% if request.path|slice:':19' == '/plans/start_detail' %}
                    class="active" {% endif %}>
                    <a class="sidenav-item-link" href="{% url 'plans:start_detail' project_id %}">
                        <span class="nav-text">通知及方案</span>
                    </a>
                </li>

            </div>
        </ul>
    </li>
    <li class="has-sub {% if request.path|slice:':6' == '/ex/sc' or request.path|slice:':6' == '/ex/pr' %}active  {% endif %} expand">
        <a class="sidenav-item-link" href="javascript:void(0)" data-toggle="collapse"
           data-target="#dashboard2"
           aria-expanded="false" aria-controls="dashboard">
            <i class="mdi mdi-pinwheel-outline"></i>
            <span class="nav-text">实施阶段</span> <b class="caret"></b>
        </a>
        <ul class="collapse {% if request.path|slice:':6' == '/ex/sc' or request.path|slice:':6' == '/ex/pr' %}show  {% endif %}"
            id="dashboard2" data-parent="#sidebar-menu">
            <div class="sub-menu">

                <li {% if request.path|slice:':17' == '/ex/schedule_list' %}
                    class="active" {% endif %}>
                    <a class="sidenav-item-link" href="{% url 'ex:schedule_list' project_id %}">
                        <span class="nav-text">项目记录</span>
                    </a>
                </li>
                <li {% if request.path|slice:':18' == '/ex/problem_detail' %}
                    class="active" {% endif %}>
                    <a class="sidenav-item-link" href="{% url 'ex:problem_list' project_id %}">
                        <span class="nav-text">问题列表</span>
                    </a>
                </li>

            </div>
        </ul>
    </li>
    <li class="has-sub {% if request.path|slice:':6' == '/ex/re' %}active  {% endif %} expand">
        <a class="sidenav-item-link" href="javascript:void(0)" data-toggle="collapse"
           data-target="#dashboard3"
           aria-expanded="false" aria-controls="dashboard">
            <i class="mdi mdi-barley"></i>
            <span class="nav-text">报告阶段</span> <b class="caret"></b>
        </a>
        <ul class="collapse{% if request.path|slice:':6' == '/ex/re' %} show  {% endif %}" id="dashboard3"
            data-parent="#sidebar-menu">
            <div class="sub-menu">

                <li {% if request.path|slice:':17' == '/ex/report_detail' %}
                    class="active" {% endif %}>
                    <a class="sidenav-item-link" href="{% url 'ex:report_detail' project_id %}">
                        <span class="nav-text">征求意见及报告</span>
                    </a>
                </li>


            </div>
        </ul>
    </li>

{% endblock %}
{% block content-wrapper %}
    <div class="content-wrapper" xmlns="http://www.w3.org/1999/html">
        <div class="content">
            <div class="row">
                <div class="col-lg-6">
                    <div class="card card-default">
                        <div class="card-header card-header-border-bottom d-flex justify-content-between">
                            <h2>{{ problem_info.project_name.project_name }}-问题详情</h2>
                            <a hidden href="{% url 'ex:problem_list' project_id %}" target="_blank"
                               class="btn btn-outline-primary btn-sm text-uppercase">
                                <i class=" mdi mdi-arrow-left-bold-outline mr-2"></i> 返回
                            </a>
                        </div>
                        <div class="card-body">
                            <h2><p class="text-info"><font size="4">被审计单位</font></p></h2>
                            <font size="4" color="black">{{ problem_info.audit_company.audit_company }}
                                {% if problem_info.audit_company.audit_person %} |
                                    {{ problem_info.audit_company.audit_person }}{% endif %}</font>
                            <p class="text-info"><font size="4">问题名称</font></p>
                            <font size="4" color="black">{{ problem_info.problem_title }}</font>
                            <p class="text-info"><font size="4">问题内容</font></p>
                            <font size="4" color="black">{{ problem_info.problem_content }}</font>
                            <p class="text-info"><font size="4" color="#ff00ff">问题反馈</font></p>
                            <font size="4" color="black">{{ problem_info.problem_feedback }}</font>
                            <p class="text-info"><font size="4">问题分类</font></p>
                            <font size="4" color="black">{{ problem_info.problem_class }}</font>
                            <p class="text-info"><font size="4">问题类型</font></p>
                            <font size="4" color="black">{{ problem_info.get_problem_type_display }}</font>
                            <p class="text-info"><font size="4">问题状态</font></p>
                            <font size="4" color="black">{{ problem_info.get_problem_status_display }}</font>
                            <p class="text-warning"><font size="4">审计人</font></p>
                            <font size="4" color="black">{% if problem_info.username.first_name %}{{ problem_info.username.first_name }}{% else %}{{ problem_info.project_name.project_exauditname }}{% endif %}</font>
                        </div>
                    </div>


                </div>
                <div class="col-lg-6">
                    {% if switch == 'open' %}
                        <div class="card card-default">

                        <div class="card-header card-header-border-bottom">
                            <h2>问题信息</h2>
                        </div>

                        <div class="card-body">
                        <form>
                        {% if problem_info.username.id == request.user.id  or user.audit_role == 'lvl1' %}
                            <div class="form-group">
                                <label for="add_audit_company">被审计公司</label>
                                <select class="form-control" id="add_audit_company" name="add_audit_company">

                                    {% for company in audit_company %}
                                        <option value="{{ company.id }}"
                                                {% if company.id == problem_info.audit_company_id %}selected{% endif %}>{{ company.audit_company }}
                                           {% if company.audit_person %} | {{ company.audit_person }}{% endif %}</option>
                                    {% endfor %}
                                    <option value="0"></option>
                                </select>
                            </div>
                            {% endif %}
                            {% if problem_info.username.id == request.user.id  or user.audit_role == 'lvl1' %}
                            <div class="form-group">
                                <label for="exampleFormControlInput1">问题名称</label>
                                <input type="text" class="form-control" id="add_problem_title"
                                       name="add_problem_title" placeholder="问题名称"
                                       value="{{ problem_info.problem_title }}">
                            </div>
                                {% endif %}
                        {% if problem_info.username.id == request.user.id  or user.audit_role == 'lvl1' %}
                            <div class="form-group">
                                <label for="exampleFormControlTextarea1">问题内容</label>
                                <textarea class="form-control" id="add_problem_content"
                                          name="add_problem_content"
                                          rows="5" >{{ problem_info.problem_content }}</textarea>
                            </div>
                            {% endif %}
                            {% if user.audit_role == 'lvl1' %}
                            <div class="form-group">
                                <label for="exampleFormControlTextarea1">主审反馈</label>
                                <textarea class="form-control" id="add_problem_feedback"
                                          name="add_problem_feedback"
                                          rows="3">{{ problem_info.problem_feedback }}</textarea>
                            </div>
                                {% endif %}
                            {% if problem_info.username.id == request.user.id  or user.audit_role == 'lvl1' %}
                            <div class="form-group">
                                <label for="exampleFormControlInput1">问题分类（自动填充后，<font color="#dc143c">请全选后再删除</font> ）</label>
                                <div class="input-group">
                                <input type="text" class="form-control" id="problem_class"
                                       name="problem_class" placeholder="如：内控制度、内控执行、未及时入账等"
                                       value="{{ problem_info.problem_class }}">
                                    <div class="input-group-append">
                                    <button type="submit" class="btn btn-outline-warning"
                                            id="problem_class_clean" name="problem_class_clean">清空
                                    </button>
                                </div>
                                </div>
                            </div>
                                {% endif %}
                            {% if problem_info.username.id == request.user.id or user.audit_role == 'lvl1' %}
                                <div class="form-group">
                                    <label class="text-dark mb-2 mt-4 font-weight-medium d-inline-block mr-3"
                                           for="">问题类型</label>
                                    <ul class="list-unstyled list-inline">
                                        <li class="d-inline-block mr-3">
                                            <label class="control outlined control-radio radio-success ">整改
                                                <input type="radio" name="add_problem_type"
                                                       id="add_problem_type"
                                                       {% if problem_info.problem_type == 're' %}checked="checked" {% endif %}
                                                       value="re"/>
                                                <div class="control-indicator"></div>
                                            </label>
                                        </li>
                                        <li class="d-inline-block mr-3">
                                            <label class="control outlined control-radio radio-success">建议
                                                <input type="radio" name="add_problem_type"
                                                       id="add_problem_type"
                                                       {% if problem_info.problem_type == 'sg' %}checked="checked" {% endif %}
                                                       value="sg"/>
                                                <div class="control-indicator"></div>
                                            </label>
                                        </li>
                                    </ul>
                                </div>
                            {% endif %}
                            {% if problem_info.username.id == request.user.id or user.audit_role == 'lvl1'%}
                                <div class="form-group">
                                    <label class="text-dark mb-2 mt-4 font-weight-medium d-inline-block mr-3"
                                           for="">问题状态</label>
                                    <ul class="list-unstyled list-inline">
                                        <li class="d-inline-block mr-3">
                                            <label class="control outlined control-radio radio-primary ">疑点
                                                <input type="radio" name="add_problem_status"
                                                       id="add_problem_status"
                                                        {% if problem_info.problem_status == 'do' %}
                                                       checked="checked" {% endif %}value="do"/>
                                                <div class="control-indicator"></div>
                                            </label>
                                        </li>
                                        <li class="d-inline-block mr-3">
                                            <label class="control outlined control-radio radio-primary">确认
                                                <input type="radio" name="add_problem_status"
                                                       id="add_problem_status"
                                                        {% if problem_info.problem_status == 'co' %}
                                                       checked="checked" {% endif %} value="co"/>
                                                <div class="control-indicator"></div>
                                            </label>
                                        </li>
                                        <li class="d-inline-block mr-3">
                                            <label class="control outlined control-radio radio-primary">消除
                                                <input type="radio" name="add_problem_status"
                                                       id="add_problem_status"
                                                        {% if problem_info.problem_status == 'el' %}
                                                       checked="checked" {% endif %}value="el"/>
                                                <div class="control-indicator"></div>
                                            </label>
                                        </li>
                                    </ul>
                                </div>
                            {% endif %}
                            {% if problem_info.username.id == request.user.id or user.audit_role == 'lvl1' %}
                                <div class="form-footer pt-4 pt-5 mt-4 border-top">
                                    <button type="submit" class="btn btn-primary btn-default"
                                            id="add_problem_submit">提交
                                    </button>
                                </div>
                            {% endif %}

                        </form>

                    </div>
                    </div>
                {% endif %}
                    <div class="card card-default">
                        <div class="card-header card-header-border-bottom">
                            <h2>问题附件</h2>
                        </div>
                        <div class="card-body">

                            {% if switch == 'open' %}
                                {% if  user.audit_role == 'lvl1' or problem_info.username.id == request.user.id %}
                                <button type="button"
                                        class="mb-1 btn btn-pill btn-block  btn-outline-danger"
                                        data-toggle="modal"
                                        data-target="#exampleModalForm">
                                    上传附件
                                </button>

                                <div class="card-body">
                                    <div class="modal fade" id="exampleModalForm" tabindex="-1" role="dialog"
                                         aria-labelledby="exampleModalFormTitle" aria-hidden="true">
                                        <div class="modal-dialog" role="document">
                                            <div class="modal-content">
                                                <div class="modal-header">
                                                    <h5 class="modal-title" id="exampleModalFormTitle">问题附件</h5>
                                                    <button type="button" class="close" data-dismiss="modal"
                                                            aria-label="Close">
                                                        <span aria-hidden="true">&times;</span>
                                                    </button>
                                                </div>
                                                <div class="modal-body">
                                                    {#                                                        <form id="jsAvatarForm" enctype="multipart/form-data"#}
                                                    {#                                                          method="post"#}
                                                    {#                                                          action="{% url 'plans:notice_file' %}"#}
                                                    {#                                                          enctype="multipart/form-data">#}
                                                    {#                                                        {% csrf_token %}#}
                                                    <input type="file"
                                                           id="problem_file1"
                                                           name="problem_file1">
                                                    <input type="submit" class="mb-1 btn  disabled btn-primary"
                                                           id="problem_file_up">
                                                    {#                                                        </form>#}
                                                </div>
                                                <div class="modal-footer">
                                                    <button type="button" class="btn btn-danger btn-pill"
                                                            data-dismiss="modal">关闭
                                                    </button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                    {% endif %}
                            {% endif %}
                            <table class="table table-hover ">
                                <thead>
                                <tr>
                                    <th scope="col">序号</th>
                                    <th scope="col">文件名称</th>
                                    <th scope="col"></th>
                                </tr>
                                </thead>
                                <tbody>
                                {% for file in problem_file_list %}
                                    <tr class="problem_file_list">
                                        <td scope="row">{{ forloop.counter }}</td>
                                        <td><a href="


                                                {{ MEDIA_URL }}{{ file.problem_file }}">{{ file.problem_file.name|slice:"22:" }}</a>
                                        </td>
                                        {% if switch == 'open'  %}
                                            {% if user.audit_role == 'lvl1' or problem_info.username_id == request.user.id %}
                                            <td>
                                                <button type="button"
                                                        class="mb-1 btn btn-pill btn-sm btn-outline-secondary problem_file_del"
                                                        problem_file_1="{{ file.id }}">
                                                    删除
                                                </button>
                                            </td>
                                                {% endif %}
                                        {% endif %}
                                    </tr>
                                {% endfor %}
                                </tbody>
                            </table>
                        </div>

                    </div>
                </div>
            </div>

        </div>
    </div>
{% endblock %}

{% block myjs %}
    <script>
        //-------注册地自动补全开始----------------------------------
        var audit_company = $("#problem_class");
        //创建自动完成的下拉列表，用于显示服务器返回的数据，插入在输入框后面，然后调整位置
        var autocomplete = $('<ul class="autocomplete"></ul>').hide().appendTo("#searchBox");
        //清空下拉列表的内容并且隐藏下拉列表
        var clear = function () {
            autocomplete.empty().hide();
        };
        //注册事件，当输入框失去焦点的时候清空下拉列表并隐藏
        audit_company.blur(function () {
            setTimeout(clear, 500);
        });
        //下拉列表中高亮的项目的索引，当显示下拉列表项的时候，移动鼠标或者键盘的下键就会移动高亮的项目
        var selectedItem = null;
        var timeoutId = null;
        //设置下拉项的高亮背景
        var setSelectedItem = function (item) {
            selectedItem = item;
            //按上下键是循环显示的，小于0就设置成最大值，大于最大值就设置成0
            if (selectedItem < 0) {
                selectedItem = autocomplete.find("li").length - 1;
            } else if (selectedItem > autocomplete.find("li").length - 1) {
                selectedItem = 0;
            }
            //首先移除其他列表项的高亮背景，然后再高亮当前索引的背景
            autocomplete.find("li").removeClass("highlight")
                .eq(selectedItem).addClass("highlight");
        };
        var ajax_request = function () {
//        ajax服务端通信
            $.ajax({
                url: "{% url 'ex:auto_problem_class' %}",
                {#contentType:"application/x-www-form-urlencoded:charset=UTF-8",#}
                type: "GET",
                {#dataType:"json",#}
                data: {"problem_class": $("#problem_class").val(),
                        "project_id": '{{ project_id }}'},
                success: function (callback) {
                    if (callback.status == 'ok') {
                             toastr.success(callback.msg);
                            $("#problem_class").val(callback.msg);
                    } else {
                        var autocompany1 = callback.msg;
                        var autocompany2 = autocompany1.slice(2);
                        var autocompany3 = autocompany2.slice(0, -2);
                        var autocompany = autocompany3.replace(/'/g, "");
                        {#var autocompany=autocompany4.split(",")#}
                        toastr.success(autocompany);
                        {#$("#audit_company").autocomplete({#}
                        {#source: autocompany#}
                        //};
                    }

                    {#var autocompany=["大壳宝","大壳美","大壳棒棒哒","厉害了我的壳"];#}
                    //如果有数据
                    if (autocompany.length > 0) {
                        $.each(autocompany, function (index, term) {
                            //创建li标签，添加到下拉列表中
                            $('<li></li>').text(term).appendTo(autocomplete)
                                .addClass("clickable")
                                .hover(function () {
                                    $(this).siblings().removeClass("highlight");
                                    $(this).addClass("highlight");
                                    selectedItem = index;
                                }, function () {
                                    $(this).removeClass("highlight");
                                    selectedItem = -1;
                                }).click(function () {
                                //鼠标单击下拉列表的这一项的话，就将这一项的值添加到输入框中
                                audit_company.val(term);
                                //清空并隐藏下拉列表
                                autocomplete.empty().hide();
                            });
                        });//事件注册完毕
                        //设置下拉列表的位置，然后显示下拉列表
                        var ypos = audit_company.height() + 4;
                        var xpos = audit_company.position().left;
                        autocomplete.css('width', audit_company.css('width'));
                        autocomplete.css({
                            'position': 'absolute',
                            'left': xpos + 'px',
                            'top': ypos + 'px',
                            "z-index": "100"
                        });
                        setSelectedItem(0);
                        //显示下拉列表
                        autocomplete.show();
                    }
                }
            });
        };
        //对输入框进行事件注册
        audit_company.keyup(function (e) {
            //字母数字、退格、空格
            if (e.keyCode > 40 || e.keyCode == 8 || e.keyCode == 32) {
                //首先删除下拉列表中的信息
                autocomplete.empty().hide();
                clearTimeout(timeoutId);
                timeoutId = setTimeout(ajax_request, 100);
            } else if (e.keyCode == 38) {
                //上
                //selectedItem=-1代表鼠标离开
                if (selectedItem == -1) {
                    setSelectedItem(autocomplete.find("li").length - 1);
                } else {
                    //索引减1
                    setSelectedItem(selectedItem - 1);
                }
                e.preventDefault();
            } else if (e.keyCode == 40) {
                //下
                if (selectedItem == -1) {
                    setSelectedItem(0);
                } else {
                    setSelectedItem(selectedItem + 1);
                }
                e.preventDefault();
            }
        }).keypress(function (e) {
            //enter回车键
            if (e.keyCode == 13) {
                //列表为空或者鼠标离开导致当前没有索引值
                if (autocomplete.find("li").length == 0 || selectedItem == -1) {
                    return;
                }
                audit_company.val(autocomplete.find("li").eq(selectedItem).text());
                autocomplete.empty().hide();
                e.preventDefault();
            }
        }).keydown(function (e) {
            //esc后退
            if (e.keyCode == 27) {
                autocomplete.empty().hide();
                e.preventDefault();
            }
        });
        //------注册地自动补全结束----------------------------
    </script>
    <script>
        $(function () {
            $('#add_problem_submit').click(function () {
                if (window.confirm('你确定提交吗？')) {
                    //alert("确定"); return true; }
                    {# 如果拿的是非表单类元素的值,用text(),如果是表单类元素用val() #}
                    var audit_company = $('#add_audit_company').val();
                    var problem_title = $('#add_problem_title').val();
                    var problem_content = $('#add_problem_content').val();
                    var problem_feedback = $('#add_problem_feedback').val();
                    var problem_class = $('#problem_class').val();
                    var problem_type = $('input[name=\'add_problem_type\']:checked').val();
                    var problem_status = $('input[name=\'add_problem_status\']:checked').val();
                    $.ajax({
                        type: 'POST',
                        url: '{% url 'ex:fix_problem' %}',
                        dataType: 'json',
                        data: {
                            "audit_company": audit_company,
                            "problem_title": problem_title,
                            "problem_content": problem_content,
                            "problem_feedback": problem_feedback,
                            "problem_class": problem_class,
                            "problem_type": problem_type,
                            "problem_status": problem_status,
                            "problem_id":{{ problem_info.id }},
                            'project_id': '{{ project_id }}',
                            "csrfmiddlewaretoken": '{{ csrf_token }}',
                        },
                        success: function (callback) {
                            if (callback.status == 'ok') {
                                toastr.success(callback.msg);
                                {#alert(callback.msg);#}
                                {#window.location.href = '{% url 'ex:problem_list' project_id %}';#}
                                window.location.reload()
                                {# 拿到点击对象的祖先节点 当中有类名是des的祖先节点 #}
                                {#obj.parents('.module1_5').remove()#}
                                {#$('#notice_info_box').remove()#}
                                {#$('#notice_info_box').location.reload()#}
                            } else {
                                {#toastr.success(callback.msg);#}
                                alert(callback.msg);

                            }
                        }
                    });

                    {# 如果你不想让submit有提交的动作,那么就需要在事件函数的最后返回false,阻止提交动作的发生 #}
                    return false;
                } else {
                    {#//alert("取消"); return false; }#}
                    alert("取消")
                }

            })
            $('#problem_file_up').click(function () {
                if (window.confirm('你确定新增吗？')) {
                    //alert("确定"); return true; }
                    {# 如果拿的是非表单类元素的值,用text(),如果是表单类元素用val() #}
                    var formdata = new FormData();
                    var problem_file = $('#problem_file1')[0].files[0];
                    formdata.append('problem_file', problem_file);
                    formdata.append('project_id', '{{ project_id }}');
                    formdata.append('problem_id', '{{ problem_info.id }}');
                    formdata.append('audit_company', '{{ problem_info.audit_company_id }}');
                    formdata.append('csrfmiddlewaretoken', '{{ csrf_token }}'),
                        $.ajax({
                            type: 'POST',
                            url: '{% url 'ex:add_problem_file' %}',
                            {#dataType: 'json',#}
                            data: formdata,
                            contentType: false,
                            {#不设置内容类型    #}
                            processData: false,
                            success: function (callback) {
                                if (callback.status == 'ok') {
                                    {#alert(callback.msg);#}
                                    {#window.location.href = '{% url 'plans:plans_list' %}';#}
                                    {#window.location.reload()#}
                                    {# 拿到点击对象的祖先节点 当中有类名是des的祖先节点 #}
                                    {#obj.parents('.module1_5').remove()#}
                                    {#$('#notice_info_box').remove(),#}
                                    window.location.reload();
                                    toastr.success(callback.msg);
                                } else {
                                    toastr.success(callback.msg);
                                    {#alert(callback.msg);#}
                                }
                            }
                        });

                    {# 如果你不想让submit有提交的动作,那么就需要在事件函数的最后返回false,阻止提交动作的发生 #}
                    {#return false;#}
                } else {
                    {#//alert("取消"); return false; }#}
                    alert("取消")
                }

            })
            $('.problem_file_del').click(function () {
                if (window.confirm('你确定删除吗？')) {
                    //alert("确定"); return true; }
                    {# 如果拿的是非表单类元素的值,用text(),如果是表单类元素用val() #}
                    var problem_file = $(this).attr('problem_file_1');
                    var obj = $(this);
                    $.ajax({
                        type: 'GET',
                        url: '{% url 'ex:del_problem_file' %}',
                        data: {
                            "problem_file": problem_file,
                            "problem_id": '{{ problem_info.id }}',
                        },
                        success: function (callback) {
                            if (callback.status == 'ok') {
                                toastr.success(callback.msg);
                                {#alert(callback.msg);#}
                                {#window.location.href = '{% url 'plans:plans_list' %}';#}
                                {#window.location.reload()#}
                                {# 拿到点击对象的祖先节点 当中有类名是des的祖先节点 #}
                                {#obj.parents('.module1_5').remove()#}
                                {#$('#notice_info_box').remove()#}
                                obj.parents('.problem_file_list').remove()
                                {#obj.parents('.notice_del_body').reload()#}
                            } else {
                                {#toastr.success(callback.msg);#}

                                alert(callback.msg);
                            }
                        }
                    });

                    {# 如果你不想让submit有提交的动作,那么就需要在事件函数的最后返回false,阻止提交动作的发生 #}
                    {#return false;#}
                } else {
                    {#//alert("取消"); return false; }#}
                    alert("取消")
                }

            })
            $('#problem_class_clean').click(function () {
                $("#problem_class").val('');
                return false;

            })

        })

    </script>
{% endblock %}